package org.sbt.service.impl;

import javax.annotation.Resource;

import org.sbt.mapper.UserMapper;
import org.sbt.model.User;
import org.sbt.service.Demo2Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("demo2Service")
public class Demo2ServiceImpl implements Demo2Service{
	@Resource
	private UserMapper userMapper;
	@Override
	public String sayHello(String name) {
		return "sbt-dubbo-provider:"+name;
	}
	@Transactional
	@Override
	public User load(Integer id) {
//		userMapper.add(new User(9,"rrr"));
//		if(true){
//			throw new  RuntimeException("ddd");
//		}
		return userMapper.load(id);
	}

}
